﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Emoney.UserTraining.Comm;
using Emoney.UserTraining.Model;


namespace Emoney.UserTraining.DAL
{
   public class GuangGaoDAL
    {
       public GuangGaoEntity GetByPID(string clienttype,string  type,string pid,int gq)
       {
           string sql = "select top 1 * from  GuangGao where pid=@pid and clienttype=@clienttype and Type=@type and gq=@gq ";
           SQLTools tool = new SQLTools();
           tool.AddSqlParameter("pid", System.Data.SqlDbType.VarChar, pid);
           tool.AddSqlParameter("clienttype", System.Data.SqlDbType.VarChar, clienttype);
           tool.AddSqlParameter("type", System.Data.SqlDbType.VarChar, type);
           tool.AddSqlParameter("gq", System.Data.SqlDbType.Int, gq);
           return SqlHelper.GetDataByColumns<GuangGaoEntity>(Config.CMS, sql, tool.GetSqlParameters());
       }
       public GuangGaoEntity GetByPID( string type, string pid, int gq)
       {
           string sql = "select top 1 * from  GuangGao where pid=@pid  and Type=@type and gq=@gq ";
           SQLTools tool = new SQLTools();
           tool.AddSqlParameter("pid", System.Data.SqlDbType.VarChar, pid);
           tool.AddSqlParameter("type", System.Data.SqlDbType.VarChar, type);
           tool.AddSqlParameter("gq", System.Data.SqlDbType.Int, gq);
           return SqlHelper.GetDataByColumns<GuangGaoEntity>(Config.CMS, sql, tool.GetSqlParameters());
       }
    }
}
